package com.jeesite.common.web;

public class ResponseData<T> {

    private String resultCode;

    private String msg;

    private T data;

    public static <T> ResponseData<T> success(T data) {
        ResponseData<T> res = new ResponseData<>();
        res.setData(data);
        res.setResultCode("SUCCESS");
        return res;
    }


    public static <T> ResponseData<T> error(String msg) {
        ResponseData<T> res = new ResponseData<>();
        res.setMsg(msg);
        res.setResultCode("FAIL");
        return res;
    }
    public String getResultCode() {
        return resultCode;
    }

    public void setResultCode(String resultCode) {
        this.resultCode = resultCode;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
